package controller

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"github.com/go-orm/app/user/model"
	"reflect"
)

func addHandler(c *gin.Context) {

	/*u := model.User{
		ID: 3,
		Username: "wxp",
		Password: "123",
	}

	typeA := reflect.TypeOf(u)
	fmt.Println(reflect.ValueOf(u))
	fmt.Println(typeA.NumField())
	fmt.Println(typeA.Field(1))
	fmt.Println(typeA.Name())
	fmt.Println(typeA.Kind())

	fmt.Println()



	typeDao := reflect.TypeOf(dao.GetUserDao())

	val1 := reflect.ValueOf(dao.GetUserDao())
	val1.Kind()
	fmt.Println(typeDao.Name())
	fmt.Println(typeDao.Kind())
	fmt.Println(reflect.ValueOf(typeDao))*/

	u := &model.User{
		ID: 3,
		Username: "wxp",
		Password: "123",
	}

	val1 := reflect.ValueOf(u)
	fmt.Println(val1.Type())
	fmt.Println(val1.Type().Elem())
	fmt.Println(val1.Elem())

	//dao.GetUserDao().Add(u)

	c.JSON(300, gin.H{
		"name": "shop1",
	})
}

func queryHandler(c *gin.Context) {
	c.JSON(300, gin.H{
		"name": "shop2",
	})
}
